<template>
  <div class="app-container">
    <iframe class="center" ref="iframeRef" :src="bUrl" width="100%" @load="onIframeLoad"></iframe>
  </div>
</template>

<script lang="ts" setup>

import {ref, onMounted, onUnmounted, computed} from 'vue'
import {useStore} from "vuex";

const store = useStore()
const username = computed(() => store.state.auth.user)
const bUrl = computed(() => 'http://116.6.92.6:8076/uniapp-sys#/pages/lianGui/baogong2?username=' + store.state.auth.user + '&t=' + Date.now())
// const bUrl = computed(() => 'http://localhost:9063/uniapp-sys#/pages/lianGui/baogong2?username=' + store.state.auth.user + '&t=' + Date.now())

// const bUrl = 'https://one.rainbowklgz.com:8076/uniapp-sys#/pages/lianGui/baogong2?username=%E9%99%88%E5%BE%B7%E7%90%AA'; // 确保支持 HTTPS

const iframeRef = ref(null);

</script>

<style scoped>
/* main-container全局样式 */
.app-container {
  margin: -20px;
  margin-top: -65px;
  height: calc(100vh - 8px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.center {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
</style>
